import {DeleteByIdRes, QueryParams, QueryRes, SaveParams, SaveRes} from "@/api/daily/ticket/type.ts";
import request from "@/utils/request.ts";


export function deleteById(id: any): Promise<DeleteByIdRes> {
    return request.delete(`/business/admin/dailyTrainTicket/delete/${id}`);
}

/**
 * query
 * @param {object} params DailyTrainTicketQueryReq
 * @param {number} params.pageNum
 * @param {number} params.pageSize
 * @returns
 */
export function query(params: QueryParams): Promise<QueryRes> {
    return request.post(`/business/dailyTrainTicket/quest-list`, params);
}

/**
 * save
 * @param {object} params DailyTrainTicketSaveReq
 * @param {number} params.id
 * @param {object} params.date
 * @param {string} params.trainCode
 * @param {string} params.start
 * @param {string} params.startPinyin
 * @param {object} params.startTime
 * @param {number} params.startIndex
 * @param {string} params.end
 * @param {string} params.endPinyin
 * @param {object} params.endTime
 * @param {number} params.endIndex
 * @param {number} params.ydz
 * @param {number} params.ydzPrice
 * @param {number} params.edz
 * @param {number} params.edzPrice
 * @param {number} params.rw
 * @param {number} params.rwPrice
 * @param {number} params.yw
 * @param {number} params.ywPrice
 * @param {object} params.createTime
 * @param {object} params.updateTime
 * @returns
 */
export function save(params: SaveParams): Promise<SaveRes> {
    return request.post(`/business/admin/dailyTrainTicket/save`, params);
}